package com.game.dongzhao.bean;

import java.io.*;
import java.util.Scanner;

/**
 * 文案
 * 如何实现好？
 * 从txt记录到数组变动行数后怎么办？
 * 在txt里每行添加编号，更新后编号从末尾开始添加
 * <p>
 * 多文件
 */
public class CopyWriter {
    /**
     * 文案
     */
    int line = 50;

    String[] txt1_1 = new String[line];
    String[] txt1_2 = new String[line];
    String[] txt2_1 = new String[line];
    String[] txt2_2 = new String[line];
    String[] txt2_3 = new String[line];
    String[] txt2_4 = new String[line];
    String[] txt2_5 = new String[line];
    String[] txt2_6 = new String[line];
    String[] txt2_7 = new String[line];
    String[] txt2_8 = new String[line];
    String[] txt2_9 = new String[line];
    String[] txt2_10 = new String[line];
    String[] txt2_11 = new String[line];
    String[] txt2_12 = new String[line];
    String[] start = new String[line];
    String[] end = new String[line];
    String[] aside = new String[line];
    String[] boss = new String[line];
    String[][] allTxt = {txt1_1, txt1_2, txt2_1, txt2_2, txt2_3, txt2_4, txt2_5, txt2_6, txt2_7, txt2_8, txt2_9, txt2_10, txt2_11, txt2_12, boss, end};
    int i = 0;

    public void scanCopyWrite() throws IOException {
        for (i = 0; i < 17; i++) {
            switch (i) {
                case 0:
                    File file0 = new File("assert/words/main/Map1-1.txt");
                    getTxt(file0);
                    break;
                case 1:
                    File file1 = new File("assert/words/main/Map1-2.txt");
                    getTxt(file1);
                    break;
                case 2:
                    File file2 = new File("assert/words/main/Map2-1.txt");
                    getTxt(file2);
                    break;
                case 3:
                    File file3 = new File("assert/words/main/Map2-2.txt");
                    getTxt(file3);
                    break;
                case 4:
                    File file4 = new File("assert/words/main/Map2-3.txt");
                    getTxt(file4);
                    break;
                case 5:
                    File file5 = new File("assert/words/main/Map2-4.txt");
                    getTxt(file5);
                    break;
                case 6:
                    File file6 = new File("assert/words/main/Map2-5.txt");
                    getTxt(file6);
                    break;
                case 7:
                    File file7 = new File("assert/words/main/Map2-6.txt");
                    getTxt(file7);
                    break;
                case 8:
                    File file8 = new File("assert/words/main/Map2-7.txt");
                    getTxt(file8);
                    break;
                case 9:
                    File file9 = new File("assert/words/main/Map2-8.txt");
                    getTxt(file9);
                    break;
                case 10:
                    File file10 = new File("assert/words/main/Map2-9.txt");
                    getTxt(file10);
                    break;
                case 11:
                    File file11 = new File("assert/words/main/Map2-10.txt");
                    getTxt(file11);
                    break;
                case 12:
                    File file12 = new File("assert/words/main/Map2-11.txt");
                    getTxt(file12);
                    break;
                case 13:
                    File file13 = new File("assert/words/main/Map2-12.txt");
                    getTxt(file13);
                    break;
//                case 14:
//                    File file14 = new File("assert/words/main/start.txt");
//                    getTxt(file14);
//                    break;
                case 14:
                    File file14 = new File("assert/words/main/boss.txt");
                    getTxt(file14);
                    break;
                case 15:
                    File file15 = new File("assert/words/main/end.txt");
                    getTxt(file15);
                    break;
//                case 16:
//                    File file16 = new File("assert/words/aside/aside.txt");
//                    getTxt(file16);
//                    break;
            }
        }

    }

    public void getTxt(File file) throws IOException {
        Scanner input = new Scanner(file);//构造Scanner类来读取文件
        int j = 0;
        while (input.hasNext()) {
            String s = input.nextLine();//逐行读取到数组中
            allTxt[i][j] = s;
            j++;
        }
        input.close();
    }

    public static void main(String[] args) throws IOException {
        CopyWriter test = new CopyWriter();
        test.getTxt(new File("assert/words/main/start.txt"));
        System.out.println(test.getAllTxt());
    }

    public int getLine() {
        return line;
    }

    public void setLine(int line) {
        this.line = line;
    }

    public String[] getTxt1_1() {
        return txt1_1;
    }

    public void setTxt1_1(String[] txt1_1) {
        this.txt1_1 = txt1_1;
    }

    public String[] getTxt1_2() {
        return txt1_2;
    }

    public void setTxt1_2(String[] txt1_2) {
        this.txt1_2 = txt1_2;
    }

    public String[] getTxt2_1() {
        return txt2_1;
    }

    public void setTxt2_1(String[] txt2_1) {
        this.txt2_1 = txt2_1;
    }

    public String[] getTxt2_2() {
        return txt2_2;
    }

    public void setTxt2_2(String[] txt2_2) {
        this.txt2_2 = txt2_2;
    }

    public String[] getTxt2_3() {
        return txt2_3;
    }

    public void setTxt2_3(String[] txt2_3) {
        this.txt2_3 = txt2_3;
    }

    public String[] getTxt2_4() {
        return txt2_4;
    }

    public void setTxt2_4(String[] txt2_4) {
        this.txt2_4 = txt2_4;
    }

    public String[] getTxt2_5() {
        return txt2_5;
    }

    public void setTxt2_5(String[] txt2_5) {
        this.txt2_5 = txt2_5;
    }

    public String[] getTxt2_6() {
        return txt2_6;
    }

    public void setTxt2_6(String[] txt2_6) {
        this.txt2_6 = txt2_6;
    }

    public String[] getTxt2_7() {
        return txt2_7;
    }

    public void setTxt2_7(String[] txt2_7) {
        this.txt2_7 = txt2_7;
    }

    public String[] getTxt2_8() {
        return txt2_8;
    }

    public void setTxt2_8(String[] txt2_8) {
        this.txt2_8 = txt2_8;
    }

    public String[] getTxt2_9() {
        return txt2_9;
    }

    public void setTxt2_9(String[] txt2_9) {
        this.txt2_9 = txt2_9;
    }

    public String[] getTxt2_10() {
        return txt2_10;
    }

    public void setTxt2_10(String[] txt2_10) {
        this.txt2_10 = txt2_10;
    }

    public String[] getTxt2_11() {
        return txt2_11;
    }

    public void setTxt2_11(String[] txt2_11) {
        this.txt2_11 = txt2_11;
    }

    public String[] getTxt2_12() {
        return txt2_12;
    }

    public void setTxt2_12(String[] txt2_12) {
        this.txt2_12 = txt2_12;
    }

    public String[] getStart() {
        return start;
    }

    public void setStart(String[] start) {
        this.start = start;
    }

    public String[] getEnd() {
        return end;
    }

    public void setEnd(String[] end) {
        this.end = end;
    }

    public String[] getAside() {
        return aside;
    }

    public void setAside(String[] aside) {
        this.aside = aside;
    }

    public String[][] getAllTxt() {
        return allTxt;
    }

    public void setAllTxt(String[][] allTxt) {
        this.allTxt = allTxt;
    }
}
